
require 'filesystem'
require 'script.base.table'
require 'script.base.math'
require 'script.base.unicode'
require 'script.base.log'
require 'script.base.utility'
require 'script.base.binary_reader'
require 'script.base.binary_writer'
require 'script.base.ini_reader'
require 'script.base.string'

--[[
    fs：
function	absolute	function: 627F55F9
function	canonical	function: 627F5ACB
function	copy_file	function: 627F5509
function	create_directories	function: 627F5050
function	create_directory	function: 627F4F75
function	current_path	function: 627F53ED
	
--返回boolean，只能做判定
function	exists	function: 627F4DBF
function	get	function: 627F5905
function	is_directory	function: 627F4E9A
function	last_write_time	function: 627F5824
function	path	function: 627F3EE1
function	relative	function: 627F572E
function	remove	function: 627F5238
function	remove_all	function: 627F5313
function	rename	function: 627F512B
function	uncomplete	function: 627F572E
function	ydwe	function: 627F59E4
number	DIR_APP_DATA	9
number	DIR_COMMON_APP_DATA	10
number	DIR_COMMON_DESKTOP	15
number	DIR_COMMON_START_MENU	7
number	DIR_DEFAULT_USER_QUICK_LAUNCH	17
number	DIR_EXE	0
number	DIR_IE_INTERNET_CACHE	6
number	DIR_LOCAL_APP_DATA	12
number	DIR_MODULE	1
number	DIR_MYPICTURES	20
number	DIR_PERSONAL	19
number	DIR_PROFILE	11
number	DIR_PROGRAM_FILES	5
number	DIR_SOURCE_ROOT	13
number	DIR_START_MENU	8
number	DIR_SYSTEM	4
number	DIR_TASKBAR_PINS	18
number	DIR_TEMP	2
number	DIR_USER_DESKTOP	14
number	DIR_USER_QUICK_LAUNCH	16
number	DIR_WINDOWS	3

]]
---遍历文件夹
local function for_directory(path, func, leaf)
	for file in (leaf and (path / leaf) or path):list_directory() do
		local leaf = (leaf and (leaf / file:filename()) or file:filename())
		if fs.is_directory(file) then
			for_directory(path, func, leaf)
		else
			func(leaf)
		end
	end
end